package com.million.eduservice.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.million.eduservice.entity.EduCourse;
import com.million.eduservice.entity.frontvo.course.CourseQueryVo;
import com.million.eduservice.entity.frontvo.course.CourseWebVo;
import com.million.eduservice.entity.vo.course.CourseInfoForm;
import com.million.eduservice.entity.vo.course.CourseInfoList;
import com.million.eduservice.entity.vo.course.CoursePublishVo;
import com.million.eduservice.entity.vo.course.CourseQuery;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 课程 服务类
 * </p>
 *
 * @author 十麓
 * @since 2022-03-24
 */
public interface EduCourseService extends IService<EduCourse> {

    /**
     * 添加课堂信息 包括 课程简介   讲师分类
     *
     * @param courseInfoForm 表单信息
     */
    String addCourseInfo (CourseInfoForm courseInfoForm);


    /**
     * 根据课程id查询 修改课程表单信息
     *
     * @param courseInfoForm 课程vo表单
     */
    void updateCourseInfo (CourseInfoForm courseInfoForm);

    /**
     * 根据课程id查询 课程信息
     *
     * @param id 课程id
     * @return 返回课程表单进行数据回显
     */
    CourseInfoForm getCourseInfo (String id);

    //根据课程id查询课程确认信息
    CoursePublishVo getPublishCourseInfo (String courseId);

    //课程提交，根据id将课程表中的status设置为已发布状态
    void publicCourse (String courseId);

    //直接查询课程信息，用vo封装
    Page<CourseInfoList> getCourseInfoList (Page<CourseInfoList> courseListPage, QueryWrapper<CourseInfoList> queryWrapper);

    //条件分页查询课程信息
    Page<CourseInfoList>  pageQueryCourse (Page<CourseInfoList> coursePage, CourseQuery courseQuery);

    //删除课程
    void deleteCourseInfo (String courseId);

    /******************************前台****************************************/
    //根据id降序，查询前8条热门课程
    List<EduCourse> selectHotCourse ();

    //分页查询课程信息
    Map<String, Object> getCourseList (Page<EduCourse> coursePage, CourseQueryVo courseQueryVo);

    //根据d 获取课程信息，编写sql语句
    CourseWebVo getBaseCourseInfo (String courseId);

    //根据课程名查询课程id，通过课程id 找到课程详情
    String queryCourseByName (String courseName);
}
